using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using System.Xml.Serialization;
using ZedGraph;

namespace ICP_MS.Plugin.Tune;

public class FormInstrumentPA : Form
{
	private DetectorCalibration pac = new DetectorCalibration();

	private IContainer components = null;

	private GroupBox gbCross;

	private ZedGraphControl graphPA;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn10;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn11;

	private TextBox txtR1;

	private System.Windows.Forms.Label lblR1;

	private Button btnCalculate;

	private DataGridView dgvDetector;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn12;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn13;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn14;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn15;

	private DataGridViewTextBoxColumn dataGridViewTextBoxColumn16;

	private DataGridViewImageColumn dataGridViewImageColumn1;

	private ToolStrip toolStrip1;

	private ToolStripButton tsbtnStartPA;

	private ToolStripButton tsbtnStopPA;

	private ToolStripButton tsbtnCreatePA;

	private ToolStripSeparator toolStripSeparator1;

	private ToolStripProgressBar progressPA;

	private ToolStripLabel toolStripLabel1;

	private ToolStripLabel toolStripLabelPA;

	private ToolStripTextBox toolStripTextBoxPA;

	private ToolStripSeparator toolStripSeparator2;

	private ToolStripLabel toolStripLabel4;

	private ToolStripLabel toolStripLabel5;

	private ToolStripTextBox toolStripTextBox2;

	private ToolStripTextBox toolStripTextBox3;

	private ToolStripLabel toolStripLabel3;

	private ToolStripTextBox toolStripTextBox4;

	private TableLayoutPanel tableLayoutPanel1;

	private Panel panel1;

	private ToolStripButton toolStripButton1;

	private ToolStripButton toolStripButton2;

	private Button btnReset;

	private ToolStripLabel tstmsg;

	private ToolStripTextBox toolStripTextBox1;

	private DataGridViewCheckBoxColumn colMeasure;

	private DataGridViewTextBoxColumn colSymbol;

	private DataGridViewTextBoxColumn colMass;

	private DataGridViewTextBoxColumn colFactorK;

	private DataGridViewTextBoxColumn colFactorB;

	private DataGridViewTextBoxColumn colCalculateK;

	private DataGridViewTextBoxColumn colCalculateB;

	private DataGridViewTextBoxColumn colError;

	private DataGridViewTextBoxColumn colErrorB;

	private DataGridViewTextBoxColumn ColLowPC;

	private DataGridViewTextBoxColumn ColLowANA;

	private DataGridViewTextBoxColumn ColHighPC;

	private DataGridViewTextBoxColumn ColHighANA;

	private DataGridViewCheckBoxColumn colInclude;

	private ToolStripButton toolStripButton3;

	private ToolStripButton toolStripButton4;

	public FormInstrumentPA()
	{
		InitializeComponent();
	}

	private void FormInstrumentCalibration_Load(object sender, EventArgs e)
	{
		base.WindowState = FormWindowState.Maximized;
		InitPA();
		toolStripTextBoxPA.Text = Detector.detectorConfig.PaThreshold.ToString("f2");
		toolStripTextBox3.Text = Detector.detectorConfig.MinPC.ToString();
		toolStripTextBox4.Text = Detector.detectorConfig.MaxPC.ToString();
		pac.recommondPC1 = Detector.detectorConfig.MinPC;
		pac.recommondPC2 = Detector.detectorConfig.MaxPC;
		Detector.ExperimentStateChanged += Detector_ExperimentStateChanged;
		UserManager.UserChanged += UserManager_UserChanged;
		ApplyResources();
		PermissionManagement();
		PA_RefreshCurve(null, null);
	}

	private void UserManager_UserChanged(object sender, EventArgs e)
	{
		PermissionManagement();
	}

	private void PermissionManagement()
	{
		if (UserManager.CurrentUser.authority <= 1)
		{
			toolStripLabelPA.Visible = false;
			toolStripTextBoxPA.Visible = false;
			toolStripTextBox3.Visible = false;
			toolStripLabel3.Visible = false;
			toolStripTextBox4.Visible = false;
		}
		else
		{
			toolStripLabelPA.Visible = true;
			toolStripTextBoxPA.Visible = true;
			toolStripTextBox3.Visible = true;
			toolStripLabel3.Visible = true;
			toolStripTextBox4.Visible = true;
		}
	}

	private void Detector_ExperimentStateChanged(object sender, ExperimentStateArgs e)
	{
		if (e.State == 2)
		{
			pac.Stop();
		}
	}

	private void ApplyResources()
	{
		Text = Lang.Txt("FormInstrumentCalibration.Title.Text");
		tsbtnCreatePA.Text = Lang.Txt("FormInstrumentCalibration.Save.Text");
		tsbtnStartPA.Text = Lang.Txt("FormInstrumentCalibration.Start.Text");
		tsbtnStopPA.Text = Lang.Txt("FormInstrumentCalibration.Stop.Text");
		lblR1.Text = Lang.Txt("FormInstrumentCalibration.Coeffient.Text");
		btnCalculate.Text = Lang.Txt("FormInstrumentCalibration.Calculate.Text");
		btnReset.Text = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.Reset");
		colMeasure.HeaderText = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.colMeasure");
		colSymbol.HeaderText = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.colSymbol");
		colMass.HeaderText = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.colMass");
		colFactorK.HeaderText = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.colFactorK");
		colFactorB.HeaderText = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.colFactorB");
		colCalculateK.HeaderText = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.colCalculateK");
		colCalculateB.HeaderText = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.colCalculateB");
		colError.HeaderText = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.colError");
		colErrorB.HeaderText = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.colErrorB");
		colInclude.HeaderText = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.colInclude");
		toolStripLabelPA.Text = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.toolStripLabelPA");
		toolStripButton1.Text = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.toolStripButton1");
		toolStripButton2.Text = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.toolStripButton2");
		toolStripButton3.Text = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.ExportPA");
		toolStripButton4.Text = Lang.Txt("ADDTune.Calibration.DetectorCrossCorrection.ImportPA");
	}

	private void FormInstrumentCalibration_FormClosing(object sender, FormClosingEventArgs e)
	{
		DisposePA();
		Detector.detectorConfig.MinPC = pac.recommondPC1;
		Detector.detectorConfig.MaxPC = pac.recommondPC2;
		pac.Save();
		Detector.ExperimentStateChanged -= Detector_ExperimentStateChanged;
		UserManager.UserChanged -= UserManager_UserChanged;
	}

	public void StopRun()
	{
	}

	private void InitPA()
	{
		pac.Init();
		graphPA.GraphPane.Title.Text = "";
		graphPA.GraphPane.XAxis.Title.Text = "m/z";
		graphPA.GraphPane.YAxis.Title.Text = "PA-K";
		graphPA.GraphPane.Fill.Color = SystemColors.Control;
		BindDatasPA();
		pac.RefreshCurve += PA_RefreshCurve;
		pac.RefreshDatas += PA_RefreshDatas;
		pac.RefreshProgress += PA_RefreshProgress;
		pac.RefreshMsg += Pac_RefreshMsg;
		pac.CalibrationFinish += PA_CalibraitonFinished;
	}

	private void Pac_RefreshMsg(object sender, EventArgs e)
	{
		Invoke((MethodInvoker)delegate
		{
			string text = (string)sender;
			tstmsg.Text = text;
		});
	}

	private void DisposePA()
	{
		pac.RefreshCurve -= PA_RefreshCurve;
		pac.RefreshDatas -= PA_RefreshDatas;
		pac.RefreshProgress -= PA_RefreshProgress;
		pac.RefreshMsg -= Pac_RefreshMsg;
	}

	private void BindDatasPA()
	{
		dgvDetector.AutoGenerateColumns = false;
		if (dgvDetector.DataSource == null)
		{
			dgvDetector.DataSource = pac.CurrentFactors;
			return;
		}
		BindingContext[dgvDetector.DataSource].SuspendBinding();
		dgvDetector.DataSource = null;
		dgvDetector.DataSource = pac.CurrentFactors;
		BindingContext[dgvDetector.DataSource].ResumeBinding();
	}

	private void PA_RefreshProgress(object sender, EventArgs e)
	{
		Invoke((MethodInvoker)delegate
		{
			progressPA.PerformStep();
		});
	}

	private void PA_RefreshDatas(object sender, EventArgs e)
	{
		Invoke((MethodInvoker)delegate
		{
			dgvDetector.Refresh();
		});
	}

	private void PA_RefreshCurve(object sender, EventArgs e)
	{
		IEnumerable<double> ms = from factor in pac.CurrentFactors
			where factor.include
			select factor.mass;
		IEnumerable<double> f = from factor in pac.CurrentFactors
			where factor.include
			select factor.factorK;
		IEnumerable<double> b = from factor in pac.CurrentFactors
			where factor.include
			select factor.factorB;
		IEnumerable<double> nb = from factor in pac.CurrentFactors
			where !factor.include
			select factor.factorB;
		IEnumerable<double> nms = from factor in pac.CurrentFactors
			where !factor.include
			select factor.mass;
		IEnumerable<double> nf = from factor in pac.CurrentFactors
			where !factor.include
			select factor.factorK;
		double a0 = pac.CurrentCurve.a0;
		double a1 = pac.CurrentCurve.a1;
		double a2 = pac.CurrentCurve.a2;
		double a3 = pac.CurrentCurve.a3;
		double[] lx = new double[300];
		double[] ly = new double[300];
		for (int i = 0; i < 300; i++)
		{
			lx[i] = i;
			ly[i] = a0 + a1 * (double)i + a2 * (double)i * (double)i + a3 * (double)i * (double)i * (double)i;
		}
		DrawCurvePA(ms.ToArray(), f.ToArray(), nms.ToArray(), nf.ToArray(), lx, ly, b.ToArray(), nb.ToArray());
	}

	private void PA_CalibraitonFinished(object sender, EventArgs e)
	{
		Invoke((MethodInvoker)delegate
		{
			tsbtnStartPA.Enabled = true;
			dgvDetector.Enabled = true;
			progressPA.Value = 0;
			progressPA.Visible = false;
			Detector.Instance.ExperimentState = -1;
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.CalibrationFinished.Text"));
		});
	}

	private void btnCalculate_Click(object sender, EventArgs e)
	{
		pac.Calculate();
		dgvDetector.Refresh();
		pac.Save();
	}

	private void DrawCurvePA(double[] x1, double[] y1, double[] x2, double[] y2, double[] lx, double[] ly, double[] z1, double[] z2)
	{
		Invoke((MethodInvoker)delegate
		{
			dgvDetector.Refresh();
			txtR1.Text = pac.CurrentCurve.r.ToString("F6");
			graphPA.GraphPane.CurveList.Clear();
			LineItem lineItem = graphPA.GraphPane.AddCurve("", x1, y1, Color.Blue, SymbolType.Circle);
			lineItem.Line.IsVisible = false;
			lineItem.Line.Fill.Type = FillType.Solid;
			LineItem lineItem2 = graphPA.GraphPane.AddCurve("", x2, y2, Color.Red, SymbolType.Circle);
			lineItem2.Line.IsVisible = false;
			lineItem2.Line.Fill.Type = FillType.Solid;
			LineItem lineItem3 = graphPA.GraphPane.AddCurve("", lx, ly, Color.Black, SymbolType.None);
			graphPA.GraphPane.AxisChange();
			graphPA.Refresh();
		});
	}

	private void dgvDetector_MouseDown(object sender, MouseEventArgs e)
	{
		if (e.Button != MouseButtons.Right)
		{
			return;
		}
		ContextMenu menu = new ContextMenu();
		menu.MenuItems.Add(Lang.Txt("FormInstrumentCalibration.Menu.Add.Text"), delegate
		{
			FormMassSelect formMassSelect = new FormMassSelect(DataBase.Instance);
			if (formMassSelect.ShowDialog() == DialogResult.OK)
			{
				DetectorFactor factor = new DetectorFactor
				{
					symbol = formMassSelect.SelectedIsotope.symbol,
					mass = formMassSelect.SelectedIsotope.mass,
					measured = false,
					LowANA = -1.0,
					LowPC = -1.0,
					HighANA = -1.0,
					HighPC = -1.0,
					LowSuccess = false,
					HighSuccess = false,
					include = false
				};
				if (!pac.CurrentFactors.Exists((DetectorFactor df) => df.symbol == factor.symbol))
				{
					pac.CurrentFactors.Add(factor);
					BindDatasPA();
				}
			}
		});
		menu.MenuItems.Add(Lang.Txt("FormInstrumentCalibration.Menu.Delete.Text"), delegate
		{
			if (dgvDetector.SelectedCells != null && dgvDetector.SelectedCells.Count > 0)
			{
				pac.CurrentFactors.RemoveAt(dgvDetector.SelectedCells[0].RowIndex);
				BindDatasPA();
			}
		});
		menu.MenuItems.Add(Lang.Txt("FormScanNCS.Menu.Order.Text"), delegate
		{
			if (dgvDetector.SelectedCells != null && dgvDetector.SelectedCells.Count > 0)
			{
				pac.CurrentFactors.Sort((DetectorFactor left, DetectorFactor right) => (int)((left.mass - right.mass) * 1000.0));
				BindDatasPA();
			}
		});
		menu.Show(dgvDetector, e.Location);
	}

	private void tsbtnStartPA_Click(object sender, EventArgs e)
	{
		if (Detector.Instance.ExperimentState != -1)
		{
			if (Detector.Instance.ExperimentState == 2)
			{
				MessageBox.Show(Lang.Txt("Tune.TipsText1"), Lang.Txt("AddFormIgnite.Warn"));
				return;
			}
			if (MessageBox.Show(Lang.Txt("Tune.TipsText2"), Lang.Txt("AddFormIgnite.Warn"), MessageBoxButtons.YesNo) != DialogResult.Yes)
			{
				return;
			}
			Detector.Instance.ExperimentStateChange(Detector.Instance.ExperimentState);
		}
		if (pac.CurrentFactors.Count < 3)
		{
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.LessElement.Text"));
			return;
		}
		progressPA.Visible = true;
		progressPA.Value = 0;
		progressPA.Maximum = pac.TotalPoints + 40 + 20;
		tsbtnStartPA.Enabled = false;
		dgvDetector.Enabled = false;
		pac.Start();
	}

	private void tsbtnStopPA_Click(object sender, EventArgs e)
	{
		pac.Stop();
	}

	private void tsbtnCreatePA_Click(object sender, EventArgs e)
	{
		if (pac.CurrentCurve == null)
		{
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.NoPACurve.Text"));
		}
		else if (pac.CreateLookupTable(Detector.Instance.paDacPath1))
		{
			Detector.Instance.LoadLookupTablePA();
			Detector.detectorConfig.DetectorB = pac.CurrentCurve.b;
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.CreateTSuccess.Text"));
		}
		else
		{
			MessageBox.Show(Lang.Txt("FormInstrumentCalibration.MessageBox.CreateTFailure.Text"));
		}
	}

	private void toolStripTextBoxPA_TextChanged(object sender, EventArgs e)
	{
		try
		{
			double paTh = double.Parse(toolStripTextBoxPA.Text);
			Detector.detectorConfig.PaThreshold = paTh;
		}
		catch
		{
			toolStripTextBoxPA.Text = "12000";
			MessageBox.Show("请输入数字！");
		}
	}

	private void toolStripTextBoxPA_Click(object sender, EventArgs e)
	{
	}

	private void dgvDetector_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
	{
	}

	private void toolStripButton1_Click(object sender, EventArgs e)
	{
		for (int i = 0; i < pac.CurrentFactors.Count; i++)
		{
			pac.CurrentFactors[i].measured = true;
			pac.CurrentFactors[i].include = true;
		}
		BindDatasPA();
	}

	private void toolStripButton2_Click(object sender, EventArgs e)
	{
		for (int i = 0; i < pac.CurrentFactors.Count; i++)
		{
			pac.CurrentFactors[i].measured = false;
			pac.CurrentFactors[i].include = false;
		}
		BindDatasPA();
	}

	private void btnReset_Click(object sender, EventArgs e)
	{
		try
		{
			for (int i = 0; i < pac.CurrentFactors.Count; i++)
			{
				pac.CurrentFactors[i].measured = false;
				pac.CurrentFactors[i].include = false;
				pac.CurrentFactors[i].LowSuccess = false;
				pac.CurrentFactors[i].HighSuccess = false;
				pac.CurrentFactors[i].factorK = -1.0;
				pac.CurrentFactors[i].factorB = -1.0;
				pac.CurrentFactors[i].calculateK = -1.0;
				pac.CurrentFactors[i].calculateB = -1.0;
				pac.CurrentFactors[i].LowPC = -1.0;
				pac.CurrentFactors[i].LowANA = -1.0;
				pac.CurrentFactors[i].HighANA = -1.0;
				pac.CurrentFactors[i].HighPC = -1.0;
				pac.CurrentFactors[i].errorB = -1.0;
				pac.CurrentFactors[i].errorK = -1.0;
			}
			dgvDetector.Refresh();
			MessageBox.Show("复位成功", Lang.Txt("AddFormIgnite.Warn"));
		}
		catch (Exception ex)
		{
			Console.WriteLine(ex.Message);
		}
	}

	private void FormInstrumentPA_FormClosed(object sender, FormClosedEventArgs e)
	{
	}

	private void toolStripTextBox3_TextChanged(object sender, EventArgs e)
	{
		try
		{
			Detector.detectorConfig.MinPC = Convert.ToDouble(toolStripTextBox3.Text);
		}
		catch (Exception)
		{
		}
	}

	private void toolStripTextBox4_TextChanged(object sender, EventArgs e)
	{
		Detector.detectorConfig.MaxPC = Convert.ToDouble(toolStripTextBox4.Text);
	}

	private void toolStripButton3_Click(object sender, EventArgs e)
	{
		SaveFileDialog dlg = new SaveFileDialog();
		dlg.Filter = "Xml files(*.xml)|*.xml";
		dlg.FileName = DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss") + ".xml";
		if (dlg.ShowDialog() == DialogResult.OK)
		{
			using (FileStream fs = new FileStream(dlg.FileName, FileMode.Create, FileAccess.Write))
			{
				XmlSerializer serializer = new XmlSerializer(typeof(List<DetectorFactor>));
				serializer.Serialize(fs, pac.CurrentFactors);
			}
		}
	}

	private void toolStripButton4_Click(object sender, EventArgs e)
	{
		OpenFileDialog dlg = new OpenFileDialog();
		dlg.Filter = "Xml files(*.xml)|*.xml";
		if (dlg.ShowDialog() != DialogResult.OK)
		{
			return;
		}
		using FileStream fs = new FileStream(dlg.FileName, FileMode.Open, FileAccess.Read);
		try
		{
			XmlSerializer serializer = new XmlSerializer(typeof(List<DetectorFactor>));
			if (serializer.Deserialize(fs) is List<DetectorFactor> tmp)
			{
				pac.CurrentFactors.Clear();
				pac.CurrentFactors.AddRange(tmp.ToArray());
				BindDatasPA();
			}
		}
		catch
		{
			MessageBox.Show(Lang.Txt("FormScanNCS.MessageBox.FileNotOK.Text"));
		}
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		this.components = new System.ComponentModel.Container();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
		System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ICP_MS.Plugin.Tune.FormInstrumentPA));
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
		System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
		this.gbCross = new System.Windows.Forms.GroupBox();
		this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
		this.graphPA = new ZedGraph.ZedGraphControl();
		this.panel1 = new System.Windows.Forms.Panel();
		this.btnReset = new System.Windows.Forms.Button();
		this.btnCalculate = new System.Windows.Forms.Button();
		this.txtR1 = new System.Windows.Forms.TextBox();
		this.dgvDetector = new System.Windows.Forms.DataGridView();
		this.colMeasure = new System.Windows.Forms.DataGridViewCheckBoxColumn();
		this.colSymbol = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colMass = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colFactorK = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colFactorB = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colCalculateK = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colCalculateB = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colError = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colErrorB = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.ColLowPC = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.ColLowANA = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.ColHighPC = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.ColHighANA = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.colInclude = new System.Windows.Forms.DataGridViewCheckBoxColumn();
		this.lblR1 = new System.Windows.Forms.Label();
		this.toolStrip1 = new System.Windows.Forms.ToolStrip();
		this.tsbtnStartPA = new System.Windows.Forms.ToolStripButton();
		this.tsbtnStopPA = new System.Windows.Forms.ToolStripButton();
		this.tsbtnCreatePA = new System.Windows.Forms.ToolStripButton();
		this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
		this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
		this.tstmsg = new System.Windows.Forms.ToolStripLabel();
		this.progressPA = new System.Windows.Forms.ToolStripProgressBar();
		this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
		this.toolStripLabelPA = new System.Windows.Forms.ToolStripLabel();
		this.toolStripTextBoxPA = new System.Windows.Forms.ToolStripTextBox();
		this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
		this.toolStripLabel4 = new System.Windows.Forms.ToolStripLabel();
		this.toolStripTextBox1 = new System.Windows.Forms.ToolStripTextBox();
		this.toolStripLabel5 = new System.Windows.Forms.ToolStripLabel();
		this.toolStripTextBox2 = new System.Windows.Forms.ToolStripTextBox();
		this.toolStripTextBox3 = new System.Windows.Forms.ToolStripTextBox();
		this.toolStripLabel3 = new System.Windows.Forms.ToolStripLabel();
		this.toolStripTextBox4 = new System.Windows.Forms.ToolStripTextBox();
		this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
		this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
		this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewImageColumn1 = new System.Windows.Forms.DataGridViewImageColumn();
		this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn13 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn14 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn15 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.dataGridViewTextBoxColumn16 = new System.Windows.Forms.DataGridViewTextBoxColumn();
		this.gbCross.SuspendLayout();
		this.tableLayoutPanel1.SuspendLayout();
		this.panel1.SuspendLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvDetector).BeginInit();
		this.toolStrip1.SuspendLayout();
		base.SuspendLayout();
		this.gbCross.Controls.Add(this.tableLayoutPanel1);
		this.gbCross.Controls.Add(this.toolStrip1);
		this.gbCross.Dock = System.Windows.Forms.DockStyle.Fill;
		this.gbCross.Location = new System.Drawing.Point(0, 0);
		this.gbCross.Margin = new System.Windows.Forms.Padding(4);
		this.gbCross.Name = "gbCross";
		this.gbCross.Padding = new System.Windows.Forms.Padding(4);
		this.gbCross.Size = new System.Drawing.Size(1733, 749);
		this.gbCross.TabIndex = 0;
		this.gbCross.TabStop = false;
		this.tableLayoutPanel1.ColumnCount = 2;
		this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 49.73913f));
		this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.26087f));
		this.tableLayoutPanel1.Controls.Add(this.graphPA, 0, 1);
		this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0);
		this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 53);
		this.tableLayoutPanel1.Name = "tableLayoutPanel1";
		this.tableLayoutPanel1.RowCount = 2;
		this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 345f));
		this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100f));
		this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20f));
		this.tableLayoutPanel1.Size = new System.Drawing.Size(1725, 692);
		this.tableLayoutPanel1.TabIndex = 9;
		this.tableLayoutPanel1.SetColumnSpan(this.graphPA, 2);
		this.graphPA.Dock = System.Windows.Forms.DockStyle.Fill;
		this.graphPA.Location = new System.Drawing.Point(5, 349);
		this.graphPA.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
		this.graphPA.Name = "graphPA";
		this.graphPA.ScrollGrace = 0.0;
		this.graphPA.ScrollMaxX = 0.0;
		this.graphPA.ScrollMaxY = 0.0;
		this.graphPA.ScrollMaxY2 = 0.0;
		this.graphPA.ScrollMinX = 0.0;
		this.graphPA.ScrollMinY = 0.0;
		this.graphPA.ScrollMinY2 = 0.0;
		this.graphPA.Size = new System.Drawing.Size(1715, 339);
		this.graphPA.TabIndex = 1;
		this.tableLayoutPanel1.SetColumnSpan(this.panel1, 2);
		this.panel1.Controls.Add(this.btnReset);
		this.panel1.Controls.Add(this.btnCalculate);
		this.panel1.Controls.Add(this.txtR1);
		this.panel1.Controls.Add(this.dgvDetector);
		this.panel1.Controls.Add(this.lblR1);
		this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
		this.panel1.Location = new System.Drawing.Point(3, 3);
		this.panel1.Name = "panel1";
		this.panel1.Size = new System.Drawing.Size(1719, 339);
		this.panel1.TabIndex = 9;
		this.btnReset.Location = new System.Drawing.Point(12, 226);
		this.btnReset.Name = "btnReset";
		this.btnReset.Size = new System.Drawing.Size(84, 39);
		this.btnReset.TabIndex = 8;
		this.btnReset.Text = "复位";
		this.btnReset.UseVisualStyleBackColor = true;
		this.btnReset.Click += new System.EventHandler(btnReset_Click);
		this.btnCalculate.Location = new System.Drawing.Point(4, 32);
		this.btnCalculate.Margin = new System.Windows.Forms.Padding(4);
		this.btnCalculate.Name = "btnCalculate";
		this.btnCalculate.Size = new System.Drawing.Size(100, 29);
		this.btnCalculate.TabIndex = 5;
		this.btnCalculate.Text = "计算";
		this.btnCalculate.UseVisualStyleBackColor = true;
		this.btnCalculate.Click += new System.EventHandler(btnCalculate_Click);
		this.txtR1.Location = new System.Drawing.Point(4, 144);
		this.txtR1.Margin = new System.Windows.Forms.Padding(4);
		this.txtR1.Name = "txtR1";
		this.txtR1.ReadOnly = true;
		this.txtR1.Size = new System.Drawing.Size(92, 25);
		this.txtR1.TabIndex = 7;
		this.dgvDetector.AllowUserToAddRows = false;
		this.dgvDetector.AllowUserToDeleteRows = false;
		this.dgvDetector.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
		this.dgvDetector.BackgroundColor = System.Drawing.SystemColors.Window;
		dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
		dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
		this.dgvDetector.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
		this.dgvDetector.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
		this.dgvDetector.Columns.AddRange(this.colMeasure, this.colSymbol, this.colMass, this.colFactorK, this.colFactorB, this.colCalculateK, this.colCalculateB, this.colError, this.colErrorB, this.ColLowPC, this.ColLowANA, this.ColHighPC, this.ColHighANA, this.colInclude);
		dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
		dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control;
		dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
		dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.ControlText;
		dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Highlight;
		dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
		dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
		this.dgvDetector.DefaultCellStyle = dataGridViewCellStyle12;
		this.dgvDetector.Location = new System.Drawing.Point(104, 8);
		this.dgvDetector.Margin = new System.Windows.Forms.Padding(4);
		this.dgvDetector.Name = "dgvDetector";
		this.dgvDetector.RowHeadersWidth = 51;
		this.dgvDetector.RowTemplate.Height = 23;
		this.dgvDetector.Size = new System.Drawing.Size(1601, 331);
		this.dgvDetector.TabIndex = 2;
		this.dgvDetector.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(dgvDetector_CellFormatting);
		this.dgvDetector.MouseDown += new System.Windows.Forms.MouseEventHandler(dgvDetector_MouseDown);
		this.colMeasure.DataPropertyName = "measured";
		this.colMeasure.HeaderText = "测量";
		this.colMeasure.MinimumWidth = 6;
		this.colMeasure.Name = "colMeasure";
		this.colMeasure.Resizable = System.Windows.Forms.DataGridViewTriState.True;
		this.colMeasure.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
		this.colMeasure.Width = 80;
		this.colSymbol.DataPropertyName = "symbol";
		this.colSymbol.HeaderText = "符号";
		this.colSymbol.MinimumWidth = 6;
		this.colSymbol.Name = "colSymbol";
		this.colSymbol.ReadOnly = true;
		this.colSymbol.Width = 80;
		this.colMass.DataPropertyName = "mass";
		this.colMass.HeaderText = "质量数";
		this.colMass.MinimumWidth = 6;
		this.colMass.Name = "colMass";
		this.colMass.ReadOnly = true;
		this.colMass.Width = 80;
		this.colFactorK.DataPropertyName = "factorK";
		this.colFactorK.HeaderText = "系数K";
		this.colFactorK.MinimumWidth = 6;
		this.colFactorK.Name = "colFactorK";
		this.colFactorK.ReadOnly = true;
		this.colFactorK.Width = 125;
		this.colFactorB.DataPropertyName = "factorB";
		this.colFactorB.HeaderText = "系数B";
		this.colFactorB.MinimumWidth = 6;
		this.colFactorB.Name = "colFactorB";
		this.colFactorB.Visible = false;
		this.colFactorB.Width = 150;
		this.colCalculateK.DataPropertyName = "calculateK";
		this.colCalculateK.HeaderText = "计算值K";
		this.colCalculateK.MinimumWidth = 6;
		this.colCalculateK.Name = "colCalculateK";
		this.colCalculateK.Width = 125;
		this.colCalculateB.DataPropertyName = "calculateB";
		this.colCalculateB.HeaderText = "计算值B";
		this.colCalculateB.MinimumWidth = 6;
		this.colCalculateB.Name = "colCalculateB";
		this.colCalculateB.Visible = false;
		this.colCalculateB.Width = 150;
		this.colError.DataPropertyName = "errorK";
		this.colError.HeaderText = "误差K(%)";
		this.colError.MinimumWidth = 6;
		this.colError.Name = "colError";
		this.colError.Width = 125;
		this.colErrorB.DataPropertyName = "errorB";
		this.colErrorB.HeaderText = "误差B(%)";
		this.colErrorB.MinimumWidth = 6;
		this.colErrorB.Name = "colErrorB";
		this.colErrorB.Visible = false;
		this.colErrorB.Width = 125;
		this.ColLowPC.DataPropertyName = "LowPC";
		this.ColLowPC.HeaderText = "PC-1";
		this.ColLowPC.MinimumWidth = 6;
		this.ColLowPC.Name = "ColLowPC";
		this.ColLowPC.Visible = false;
		this.ColLowPC.Width = 140;
		this.ColLowANA.DataPropertyName = "LowANA";
		this.ColLowANA.HeaderText = "ANA-1";
		this.ColLowANA.MinimumWidth = 6;
		this.ColLowANA.Name = "ColLowANA";
		this.ColLowANA.Visible = false;
		this.ColLowANA.Width = 140;
		this.ColHighPC.DataPropertyName = "HighPC";
		this.ColHighPC.HeaderText = "PC";
		this.ColHighPC.MinimumWidth = 6;
		this.ColHighPC.Name = "ColHighPC";
		this.ColHighPC.Width = 125;
		this.ColHighANA.DataPropertyName = "HighANA";
		this.ColHighANA.HeaderText = "ANA";
		this.ColHighANA.MinimumWidth = 6;
		this.ColHighANA.Name = "ColHighANA";
		this.ColHighANA.Width = 125;
		this.colInclude.DataPropertyName = "include";
		this.colInclude.HeaderText = "计算";
		this.colInclude.MinimumWidth = 6;
		this.colInclude.Name = "colInclude";
		this.colInclude.Resizable = System.Windows.Forms.DataGridViewTriState.True;
		this.colInclude.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
		this.colInclude.Width = 80;
		this.lblR1.AutoSize = true;
		this.lblR1.Location = new System.Drawing.Point(9, 106);
		this.lblR1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.lblR1.Name = "lblR1";
		this.lblR1.Size = new System.Drawing.Size(75, 15);
		this.lblR1.TabIndex = 6;
		this.lblR1.Text = "相关系数:";
		this.lblR1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
		this.toolStrip1.AutoSize = false;
		this.toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
		this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[21]
		{
			this.tsbtnStartPA, this.tsbtnStopPA, this.tsbtnCreatePA, this.toolStripSeparator1, this.toolStripButton1, this.toolStripButton2, this.tstmsg, this.progressPA, this.toolStripLabel1, this.toolStripLabelPA,
			this.toolStripTextBoxPA, this.toolStripSeparator2, this.toolStripLabel4, this.toolStripTextBox1, this.toolStripLabel5, this.toolStripTextBox2, this.toolStripTextBox3, this.toolStripLabel3, this.toolStripTextBox4, this.toolStripButton3,
			this.toolStripButton4
		});
		this.toolStrip1.Location = new System.Drawing.Point(4, 22);
		this.toolStrip1.Name = "toolStrip1";
		this.toolStrip1.Size = new System.Drawing.Size(1725, 31);
		this.toolStrip1.TabIndex = 4;
		this.tsbtnStartPA.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnStartPA.Image = (System.Drawing.Image)resources.GetObject("tsbtnStartPA.Image");
		this.tsbtnStartPA.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnStartPA.Name = "tsbtnStartPA";
		this.tsbtnStartPA.Size = new System.Drawing.Size(29, 28);
		this.tsbtnStartPA.Text = "开始";
		this.tsbtnStartPA.Click += new System.EventHandler(tsbtnStartPA_Click);
		this.tsbtnStopPA.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnStopPA.Image = (System.Drawing.Image)resources.GetObject("tsbtnStopPA.Image");
		this.tsbtnStopPA.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnStopPA.Name = "tsbtnStopPA";
		this.tsbtnStopPA.Size = new System.Drawing.Size(29, 28);
		this.tsbtnStopPA.Text = "停止";
		this.tsbtnStopPA.Click += new System.EventHandler(tsbtnStopPA_Click);
		this.tsbtnCreatePA.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.tsbtnCreatePA.Image = (System.Drawing.Image)resources.GetObject("tsbtnCreatePA.Image");
		this.tsbtnCreatePA.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.tsbtnCreatePA.Name = "tsbtnCreatePA";
		this.tsbtnCreatePA.Size = new System.Drawing.Size(29, 28);
		this.tsbtnCreatePA.Text = "生成查找表";
		this.tsbtnCreatePA.Click += new System.EventHandler(tsbtnCreatePA_Click);
		this.toolStripSeparator1.Name = "toolStripSeparator1";
		this.toolStripSeparator1.Size = new System.Drawing.Size(6, 31);
		this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton1.Image = (System.Drawing.Image)resources.GetObject("toolStripButton1.Image");
		this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton1.Name = "toolStripButton1";
		this.toolStripButton1.Size = new System.Drawing.Size(29, 28);
		this.toolStripButton1.Text = "全部选中";
		this.toolStripButton1.Click += new System.EventHandler(toolStripButton1_Click);
		this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
		this.toolStripButton2.Image = (System.Drawing.Image)resources.GetObject("toolStripButton2.Image");
		this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton2.Name = "toolStripButton2";
		this.toolStripButton2.Size = new System.Drawing.Size(29, 28);
		this.toolStripButton2.Text = "全部取消";
		this.toolStripButton2.Click += new System.EventHandler(toolStripButton2_Click);
		this.tstmsg.Name = "tstmsg";
		this.tstmsg.Size = new System.Drawing.Size(0, 28);
		this.progressPA.AutoSize = false;
		this.progressPA.Name = "progressPA";
		this.progressPA.Size = new System.Drawing.Size(400, 28);
		this.progressPA.Step = 1;
		this.progressPA.Visible = false;
		this.toolStripLabel1.Name = "toolStripLabel1";
		this.toolStripLabel1.Size = new System.Drawing.Size(13, 28);
		this.toolStripLabel1.Text = " ";
		this.toolStripLabelPA.Name = "toolStripLabelPA";
		this.toolStripLabelPA.Size = new System.Drawing.Size(74, 28);
		this.toolStripLabelPA.Text = "PA阈值：";
		this.toolStripLabelPA.Visible = false;
		this.toolStripTextBoxPA.Font = new System.Drawing.Font("Microsoft YaHei UI", 9f);
		this.toolStripTextBoxPA.Name = "toolStripTextBoxPA";
		this.toolStripTextBoxPA.Size = new System.Drawing.Size(132, 31);
		this.toolStripTextBoxPA.Visible = false;
		this.toolStripTextBoxPA.Click += new System.EventHandler(toolStripTextBoxPA_Click);
		this.toolStripTextBoxPA.TextChanged += new System.EventHandler(toolStripTextBoxPA_TextChanged);
		this.toolStripSeparator2.Name = "toolStripSeparator2";
		this.toolStripSeparator2.Size = new System.Drawing.Size(6, 31);
		this.toolStripLabel4.Name = "toolStripLabel4";
		this.toolStripLabel4.Size = new System.Drawing.Size(63, 28);
		this.toolStripLabel4.Text = "阈值1：";
		this.toolStripLabel4.Visible = false;
		this.toolStripTextBox1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9f);
		this.toolStripTextBox1.Name = "toolStripTextBox1";
		this.toolStripTextBox1.Size = new System.Drawing.Size(50, 31);
		this.toolStripTextBox1.Visible = false;
		this.toolStripLabel5.Name = "toolStripLabel5";
		this.toolStripLabel5.Size = new System.Drawing.Size(15, 28);
		this.toolStripLabel5.Text = "-";
		this.toolStripLabel5.Visible = false;
		this.toolStripTextBox2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9f);
		this.toolStripTextBox2.Name = "toolStripTextBox2";
		this.toolStripTextBox2.Size = new System.Drawing.Size(50, 31);
		this.toolStripTextBox2.Visible = false;
		this.toolStripTextBox3.Font = new System.Drawing.Font("Microsoft YaHei UI", 9f);
		this.toolStripTextBox3.Name = "toolStripTextBox3";
		this.toolStripTextBox3.Size = new System.Drawing.Size(100, 31);
		this.toolStripTextBox3.Visible = false;
		this.toolStripTextBox3.TextChanged += new System.EventHandler(toolStripTextBox3_TextChanged);
		this.toolStripLabel3.Name = "toolStripLabel3";
		this.toolStripLabel3.Size = new System.Drawing.Size(54, 28);
		this.toolStripLabel3.Text = "<PC <";
		this.toolStripLabel3.Visible = false;
		this.toolStripTextBox4.Font = new System.Drawing.Font("Microsoft YaHei UI", 9f);
		this.toolStripTextBox4.Name = "toolStripTextBox4";
		this.toolStripTextBox4.Size = new System.Drawing.Size(100, 31);
		this.toolStripTextBox4.Visible = false;
		this.toolStripTextBox4.TextChanged += new System.EventHandler(toolStripTextBox4_TextChanged);
		this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
		this.toolStripButton3.Image = (System.Drawing.Image)resources.GetObject("toolStripButton3.Image");
		this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton3.Name = "toolStripButton3";
		this.toolStripButton3.Size = new System.Drawing.Size(63, 28);
		this.toolStripButton3.Text = "导出PA";
		this.toolStripButton3.Click += new System.EventHandler(toolStripButton3_Click);
		this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
		this.toolStripButton4.Image = (System.Drawing.Image)resources.GetObject("toolStripButton4.Image");
		this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
		this.toolStripButton4.Name = "toolStripButton4";
		this.toolStripButton4.Size = new System.Drawing.Size(63, 28);
		this.toolStripButton4.Text = "导入PA";
		this.toolStripButton4.Click += new System.EventHandler(toolStripButton4_Click);
		this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn1.DataPropertyName = "symbol";
		dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle13;
		this.dataGridViewTextBoxColumn1.HeaderText = "符号";
		this.dataGridViewTextBoxColumn1.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
		this.dataGridViewTextBoxColumn1.ReadOnly = true;
		this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn2.DataPropertyName = "mass";
		dataGridViewCellStyle14.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle14;
		this.dataGridViewTextBoxColumn2.HeaderText = "质量数";
		this.dataGridViewTextBoxColumn2.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
		this.dataGridViewTextBoxColumn2.ReadOnly = true;
		this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn3.DataPropertyName = "dac";
		dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle15;
		this.dataGridViewTextBoxColumn3.HeaderText = "计数";
		this.dataGridViewTextBoxColumn3.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
		this.dataGridViewTextBoxColumn3.ReadOnly = true;
		this.dataGridViewTextBoxColumn4.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn4.DataPropertyName = "width";
		dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle16;
		this.dataGridViewTextBoxColumn4.HeaderText = "峰宽(AMU)";
		this.dataGridViewTextBoxColumn4.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
		this.dataGridViewTextBoxColumn4.ReadOnly = true;
		this.dataGridViewTextBoxColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn5.DataPropertyName = "error";
		dataGridViewCellStyle17.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn5.DefaultCellStyle = dataGridViewCellStyle17;
		this.dataGridViewTextBoxColumn5.HeaderText = "误差";
		this.dataGridViewTextBoxColumn5.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
		this.dataGridViewTextBoxColumn5.ReadOnly = true;
		this.dataGridViewImageColumn1.DataPropertyName = "status";
		dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		dataGridViewCellStyle18.NullValue = null;
		this.dataGridViewImageColumn1.DefaultCellStyle = dataGridViewCellStyle18;
		this.dataGridViewImageColumn1.HeaderText = "";
		this.dataGridViewImageColumn1.MinimumWidth = 6;
		this.dataGridViewImageColumn1.Name = "dataGridViewImageColumn1";
		this.dataGridViewImageColumn1.ReadOnly = true;
		this.dataGridViewImageColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True;
		this.dataGridViewImageColumn1.Width = 30;
		this.dataGridViewTextBoxColumn6.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn6.DataPropertyName = "resolution";
		dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn6.DefaultCellStyle = dataGridViewCellStyle19;
		this.dataGridViewTextBoxColumn6.HeaderText = "分辨率";
		this.dataGridViewTextBoxColumn6.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
		this.dataGridViewTextBoxColumn6.ReadOnly = true;
		this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.dataGridViewTextBoxColumn7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn7.DataPropertyName = "time";
		dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn7.DefaultCellStyle = dataGridViewCellStyle2;
		this.dataGridViewTextBoxColumn7.HeaderText = "时间";
		this.dataGridViewTextBoxColumn7.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
		this.dataGridViewTextBoxColumn7.ReadOnly = true;
		this.dataGridViewTextBoxColumn7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.dataGridViewTextBoxColumn8.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn8.DataPropertyName = "coef0";
		dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn8.DefaultCellStyle = dataGridViewCellStyle3;
		this.dataGridViewTextBoxColumn8.HeaderText = "系数0";
		this.dataGridViewTextBoxColumn8.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
		this.dataGridViewTextBoxColumn8.ReadOnly = true;
		this.dataGridViewTextBoxColumn8.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.dataGridViewTextBoxColumn9.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn9.DataPropertyName = "coef1";
		dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn9.DefaultCellStyle = dataGridViewCellStyle4;
		this.dataGridViewTextBoxColumn9.HeaderText = "系数1";
		this.dataGridViewTextBoxColumn9.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
		this.dataGridViewTextBoxColumn9.ReadOnly = true;
		this.dataGridViewTextBoxColumn9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.dataGridViewTextBoxColumn10.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
		this.dataGridViewTextBoxColumn10.DataPropertyName = "coef2";
		dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn10.DefaultCellStyle = dataGridViewCellStyle5;
		this.dataGridViewTextBoxColumn10.HeaderText = "系数2";
		this.dataGridViewTextBoxColumn10.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
		this.dataGridViewTextBoxColumn10.ReadOnly = true;
		this.dataGridViewTextBoxColumn10.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
		this.dataGridViewTextBoxColumn11.DataPropertyName = "note";
		dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn11.DefaultCellStyle = dataGridViewCellStyle6;
		this.dataGridViewTextBoxColumn11.HeaderText = "备注";
		this.dataGridViewTextBoxColumn11.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
		this.dataGridViewTextBoxColumn11.ReadOnly = true;
		this.dataGridViewTextBoxColumn11.Width = 125;
		this.dataGridViewTextBoxColumn12.DataPropertyName = "time";
		dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn12.DefaultCellStyle = dataGridViewCellStyle7;
		this.dataGridViewTextBoxColumn12.HeaderText = "时间";
		this.dataGridViewTextBoxColumn12.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
		this.dataGridViewTextBoxColumn12.ReadOnly = true;
		this.dataGridViewTextBoxColumn12.Width = 125;
		this.dataGridViewTextBoxColumn13.DataPropertyName = "coef0";
		dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn13.DefaultCellStyle = dataGridViewCellStyle8;
		this.dataGridViewTextBoxColumn13.HeaderText = "系数0";
		this.dataGridViewTextBoxColumn13.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn13.Name = "dataGridViewTextBoxColumn13";
		this.dataGridViewTextBoxColumn13.ReadOnly = true;
		this.dataGridViewTextBoxColumn13.Width = 125;
		this.dataGridViewTextBoxColumn14.DataPropertyName = "coef1";
		dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn14.DefaultCellStyle = dataGridViewCellStyle9;
		this.dataGridViewTextBoxColumn14.HeaderText = "系数1";
		this.dataGridViewTextBoxColumn14.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn14.Name = "dataGridViewTextBoxColumn14";
		this.dataGridViewTextBoxColumn14.ReadOnly = true;
		this.dataGridViewTextBoxColumn14.Width = 125;
		this.dataGridViewTextBoxColumn15.DataPropertyName = "coef2";
		dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn15.DefaultCellStyle = dataGridViewCellStyle10;
		this.dataGridViewTextBoxColumn15.HeaderText = "系数2";
		this.dataGridViewTextBoxColumn15.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn15.Name = "dataGridViewTextBoxColumn15";
		this.dataGridViewTextBoxColumn15.ReadOnly = true;
		this.dataGridViewTextBoxColumn15.Width = 125;
		this.dataGridViewTextBoxColumn16.DataPropertyName = "note";
		dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
		this.dataGridViewTextBoxColumn16.DefaultCellStyle = dataGridViewCellStyle11;
		this.dataGridViewTextBoxColumn16.HeaderText = "备注";
		this.dataGridViewTextBoxColumn16.MinimumWidth = 6;
		this.dataGridViewTextBoxColumn16.Name = "dataGridViewTextBoxColumn16";
		this.dataGridViewTextBoxColumn16.ReadOnly = true;
		this.dataGridViewTextBoxColumn16.Width = 125;
		base.AutoScaleDimensions = new System.Drawing.SizeF(8f, 15f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(1733, 749);
		base.Controls.Add(this.gbCross);
		base.Margin = new System.Windows.Forms.Padding(4);
		base.Name = "FormInstrumentPA";
		base.ShowIcon = false;
		this.Text = "FormInstrumentCalibration";
		base.FormClosing += new System.Windows.Forms.FormClosingEventHandler(FormInstrumentCalibration_FormClosing);
		base.FormClosed += new System.Windows.Forms.FormClosedEventHandler(FormInstrumentPA_FormClosed);
		base.Load += new System.EventHandler(FormInstrumentCalibration_Load);
		this.gbCross.ResumeLayout(false);
		this.tableLayoutPanel1.ResumeLayout(false);
		this.panel1.ResumeLayout(false);
		this.panel1.PerformLayout();
		((System.ComponentModel.ISupportInitialize)this.dgvDetector).EndInit();
		this.toolStrip1.ResumeLayout(false);
		this.toolStrip1.PerformLayout();
		base.ResumeLayout(false);
	}
}
